<template>
	<view class="nav">
		<view class="lefticon" @click="goBack">
			<image src="/static/w-titleBar/w-titleBar1.png" mode=""></image>
			<text class="cen-text" :class="flx==2 ? 'cen-text-flx' : ''">{{title}}</text>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {

			};
		},
		props: {
			title: {
				type: String,
				default: '返回'
			},
			flx: {
				type: Number,
				default: 1
			}
		},
		methods: {
			goBack() {
				uni.navigateBack({
					delta: 1,
					animationType: 'pop-out',
					animationDuration: 200
				});
			}
		}
	}
</script>

<style>
	.nav {
		height: 80upx;
		background-color: #C42D18;
	}

	.lefticon {
		display: flex;
		height: 80upx;
		align-items: center;
	}

	.lefticon image {
		width: 50upx;
		height: 50upx;
	}

	.cen-text {
		flex: 1;
		line-height: 60upx;
		font-size: 30upx;
		margin: 0 20upx;
		color: #FFFFFF;
	}

	.cen-text-flx {
		display: flex;
		justify-content: center
	}
</style>
